package com.example.aidldemo.server

import android.app.Service
import android.content.Intent
import android.os.IBinder
import android.os.RemoteException
import com.example.aidldemo.aidl.IMyTestServer

/**
 * @author: njb
 * @date: 2025/3/19 23:24
 * @desc: 描述
 */
class MyTestService : Service() {
    private val mBinder: IMyTestServer.Stub = object : IMyTestServer.Stub() {
        @Throws(RemoteException::class)
        override fun basicTypes(
            anInt: Int,
            aLong: Long,
            aBoolean: Boolean,
            aFloat: Float,
            aDouble: Double,
            aString: String
        ) {
        }

        @Throws(RemoteException::class)
        override fun add(a: Int, b: Int): Int {
            return a + b
        }
    }

    override fun onBind(intent: Intent): IBinder? {
        return mBinder
    }
}
